import './App.css';
import { useEffect, useState } from 'react'
import ReactECharts from 'echarts-for-react';

function App() {
  let [data, setData] = useState([])

  const getOption = () => {
    return {
      title: {
        text: 'ECharts 入门示例'
      },
      tooltip: {},
      legend: {
        data:['销量']
      },
      xAxis: {
        data
      },
      yAxis: {},
      series: [{
        name: '销量',
        type: 'bar',
        data: [5, 20, 36, 10, 10, 20, 100]
      }]
    }
  }

  useEffect(() => {
    setData(["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子", "T恤2"])
  }, [])

  return (
    <div className="App">
      <ReactECharts option={getOption()}></ReactECharts>
    </div>
  );
}

export default App;
